<?php defined( 'BASEPATH' ) or die( 'Restricted' );

/*
This code is copyright 2009-2010 by TMLA INC.  ALL RIGHTS RESERVED.
Please view license.txt in /tgsf_core/legal/license.txt or
http://tgWebSolutions.com/opensource/tgsf/license.txt
for complete licensing information.
*/
$links_model = load_model( 'links' );
$action = '';
SESSION()->start();

if ( array_key_exists( 'spamflags', $_SESSION ) && array_key_exists( GET()->i, $_SESSION['spamflags'] ) )
{
	$action = 'previously-flagged';
}
else if ( GET()->dataPresent && GET()->exists( 'i' ) )
{
	$_SESSION['spamflags'][GET()->i] = true;
	
	$action = 'flagged';
	if ( $links_model->spam( GET()->i ) )
	{
		$action = 'remove';
	}
}

echo $action;